<?

function get_server_environment()
{
		if(isset($_SERVER['SERVER_NAME']))
		{
			$server_name = $_SERVER['SERVER_NAME'];
		}
		
        if (stripos($server_name, 'test.') !== FALSE || stripos($server_name, 'test') === 0)
        {
                return "testing";
        }
        elseif (stripos($server_name, 'local.') !== FALSE || stripos($server_name, 'local') === 0)
        {
                return "development";
        }
        elseif (stripos($server_name, 'beta.') !== FALSE || stripos($server_name, 'beta') === 0)
        {
                return "beta";
        }

        return "production";
}